package fun.tan90.easy.binlog.manager.dataobject.listener;

import cn.dev33.satoken.stp.StpUtil;
import com.mybatisflex.annotation.UpdateListener;
import fun.tan90.easy.binlog.manager.dataobject.BinlogOutputCount;

import java.util.Date;

/**
 * description TODO
 * company 铁人科技
 *
 * @author 陈浩杰
 * @date 2023/9/5 17:40
 */
public class BinlogOutputCountUpdateListener implements UpdateListener {

    @Override
    public void onUpdate(Object entity) {
        BinlogOutputCount binlogOutputCount = (BinlogOutputCount) entity;
        binlogOutputCount.setUpdateId(String.valueOf(StpUtil.getLoginId()));
        binlogOutputCount.setUpdateTime(new Date());
    }
}
